We weren't correctly ending the ( ) block when encountering an error.
Testcases added.
Fixes #2281
else
{
gtk_css_parser_error_syntax (parser, "Invalid contents of :not() selector");
+ gtk_css_parser_end_block (parser);
if (selector)
_gtk_css_selector_free (selector);
selector = NULL;
if (!gtk_css_token_is (token, GTK_CSS_TOKEN_EOF))
{
gtk_css_parser_error_syntax (parser, "Invalid contents of :not() selector");
+ gtk_css_parser_end_block (parser);
if (selector)
_gtk_css_selector_free (selector);
selector = NULL;
'no-semicolon.ref.css',
'not.css',
'not.ref.css',
+ 'not-unclosed.css',
+ 'not-unclosed.errors',
+ 'not-unclosed.ref.css',
'nth-child.css',
'nth-child.ref.css',
'opacity.css',
--- /dev/null
+:not(valid invalid) {}
+
+:not(
--- /dev/null
+not-unclosed.css:1:12-19: error: GTK_CSS_PARSER_ERROR_SYNTAX
+not-unclosed.css:4:1: error: GTK_CSS_PARSER_ERROR_SYNTAX
+not-unclosed.css:3:2-4:1: error: GTK_CSS_PARSER_WARNING_SYNTAX